<template>
  <section class="container">
    <div>
      <logo />
      <h1 class="title">
        nuxt-app
      </h1>
      <h2 class="subtitle">
        Welcome to the iView + Nuxt.js template
      </h2>
      <div class="links">
        <Button type="primary" target="_blank" to="https://nuxtjs.org/">
          Documentation
        </Button>
        <Button target="_blank" to="https://github.com/nuxt/nuxt.js">
          GitHub
        </Button>
        <Button target="_blank" to="https://www.iviewui.com/">iView</Button>
      </div>
      <div>
        <Button target="_self" to="/info">iView</Button>
      </div>
    </div>
  </section>
</template>

<script>
import Logo from '~/components/Logo.vue';
import { TweenMax, Back } from 'gsap';
export default {
  transition: {
    mode: 'out-in',
    css: false,
    beforeEnter(el) {
      TweenMax.set(el, {
        transformPerspective: 600,
        perspective: 300,
        transformStyle: 'preserve-3d',
      });
    },
    enter(el, done) {
      TweenMax.to(el, 1, {
        rotationY: 360,
        transformOrigin: '50% 50%',
        ease: Back.easeOut,
      });
      done();
    },
    leave(el, done) {
      TweenMax.to(el, 1, {
        rotationY: 0,
        transformOrigin: '50% 50%',
        ease: Back.easeIn,
      });
      done();
    },
  },
  components: {
    Logo,
  },
  asyncData({ app, $axios }) {
    $axios.get('/api/api-home-column').then(res => {
      console.log(res);
    });
  },
  created() {},
  mounted() {},
  methods: {},
};
</script>

<style lang="less">
.container {
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.title {
  font-family: 'Quicksand', 'Source Sans Pro', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  display: block;
  font-weight: 300;
  font-size: 100px;
  color: #35495e;
  letter-spacing: 1px;
}
.subtitle {
  font-weight: 300;
  font-size: 42px;
  color: #526488;
  word-spacing: 5px;
  padding-bottom: 15px;
}
.links {
  padding-top: 15px;
}
</style>
